package com.tablefood.service.Impl;


import java.util.List;

import javax.annotation.Resource;

import org.springframework.transaction.annotation.Transactional;

import com.tablefood.dao.OrderDetailDao;
import com.tablefood.domain.ShopOrderDetail;
import com.tablefood.service.OrderDetailService;

@Transactional
public class OrderDetailServiceImpl implements OrderDetailService {

	@Resource
	OrderDetailDao orderDetailDao;
	
	@Override
	public ShopOrderDetail insertOrderDetail(ShopOrderDetail orderDetail) {
		System.out.println("生成订单详细");
		return orderDetailDao.insertOrderDetail(orderDetail);
	}

	@Override
	public ShopOrderDetail updateOrderDetail(ShopOrderDetail orderDetail) {
		System.out.println("更新部分字段");
		return orderDetailDao.updateOrderDetail(orderDetail);
	}
	
	@Override
	public List searchOrderDetail(String orderid,String productid) {
		System.out.println("查询一个订单详细");
		return orderDetailDao.searchOrderDetail(orderid,productid);
	}

	@Override
	public List searchAllOrderDetail(String orderid) {
		System.out.println("查询所有的订单详细");
		return  orderDetailDao.searchAllOrderDetail(orderid);
	}

	@Override
	public List searchOrderDetailById(String detailid) {
		System.out.println("查询一个订单详细");
		return orderDetailDao.searchOrderDetailById(detailid);
	}

	@Override
	public ShopOrderDetail searchOneByProductid(String productid) {
 
		return orderDetailDao.searchOneByProductid(productid);
	}

	@Override
	public boolean delOneDetail(Long detailid) {
	 
		return orderDetailDao.delOneDetail(detailid);
	}

	

}
